package com.iotechn.unimall.admin.api.usercard;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.annotation.param.TextFormat;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.UserCardDO;
import com.iotechn.unimall.data.dto.DistributionDTO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;
import java.util.Map;

/**
 * 用户充值卡
 *
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-03-15 20:45:43
 */
@HttpOpenApi(group = "admin.usercard", description = "会员卡管理")
public interface AdminUserCardService {

    @HttpMethod(description = "修改", permission = "promote:usercard:update", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public String update(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "会员卡") Long id,
             @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "绑定会员id") Long userId,
            @TextFormat(length = 11) @HttpParam (name="phone",description = "绑定手机号")String phone,
            @NotNull @HttpParam (name="storeId",description = "门店id") Long storeId,
             @HttpParam (name="storeSkuid",description = "门店商品奖励") Long storeSkuid,
             @HttpParam (name="amount",description = "余额奖励了" ,valueDef = "0") Integer amount,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "promote:usercard:delete", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "删除Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "生成会员卡片", permission = "promote:usercard:product", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public Boolean productCard(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "卡ID") Long id) throws ServiceException;

    @HttpMethod(description = "导出", permission = "promote:usercard:query", permissionParentName = "推广管理", permissionName = "导出管理")
    public List<UserCardDO> queryToExcel(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "导出") Long cardId) throws ServiceException;


    @HttpMethod(description = "会员卡激活")
    public String activationCard(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "卡id") Long id,
            @NotNull @HttpParam(name = "cardNo", type = HttpParamType.COMMON, description = "卡号") String cardNo,
            @NotNull @HttpParam(name = "storeId", type = HttpParamType.COMMON, description = "门店id") Long storeId,
            @HttpParam(name = "storeSkuId", type = HttpParamType.COMMON, description = "门店商品") Long storeSkuId,
            @HttpParam(name = "amount", type = HttpParamType.COMMON, description = "奖励金额", valueDef = "0") Integer amount,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId
    )  throws ServiceException;

    @HttpMethod(description = "修改未激活的会员卡信息")
    public String  updateCard(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "卡id") Long id,
            @HttpParam(name = "money", type = HttpParamType.COMMON, description = "金额") Integer money ,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId
    ) throws ServiceException;

    @HttpMethod(description = "会员卡批量操作")
    public Integer cardBatchUpdate(
            @NotNull @HttpParam(name = "startCard", type = HttpParamType.COMMON, description = "卡号区间") Long startCard,
            @NotNull @HttpParam(name = "endCard", type = HttpParamType.COMMON, description = "卡号区间") Long endCard ,
            @NotNull @HttpParam(name = "storeId", type = HttpParamType.COMMON, description = "门店id") Long storeId ,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId
    ) throws ServiceException;
}

